-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix : Enabling urls without http in front of them [STTNHUB-252] #42
Conversation
) | ||
|
||
|
||
def transform_link_from_text(item, fields): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have this code in superdesk-core
(https://github.com/superdesk/superdesk-core/blob/develop/superdesk/text_utils.py#L193).
This is the code that is currently being used to transform plain text to rich text (for Editor3 fields).
Seems like the bug is there, and should be fixed there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Okay, let me check. Thanks, Mark!
@@ -86,6 +104,20 @@ def parse(self, tree: Element, provider=None): | |||
# If the item contains the ``sttinstruct:remove`` signal, no need to ingest this one | |||
continue | |||
self.set_extra_fields(item, tree) | |||
|
|||
fields = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functionality is already in EventsML parser from superdesk-planning
. And we have to check if the field is using Editor3
, otherwise adding HTML tags in plain text would not be ideal.
As we support this as a core feature, we should update the EventsML and PlanningML parsers to support all possible fields. See https://github.com/superdesk/superdesk-planning/blob/develop/server/planning/feed_parsers/events_ml.py#L252 for example.
We first check if the field is Editor3 in the content profile, and then attempt to convert to html. So it might be good to implement a utility in superdesk-planning
to convert multiple fields on ingest to editor3, checking it's content profile.
@devketanpro Basically this PR can be closed, and a PR in |
No description provided.